package pers.vic.upload.utils;

import org.apache.shiro.crypto.hash.Md5Hash;

/**
 * 描述:upload 中的工具类
 * @author Vic.xu
 * @date 2022-07-06 11:46
 */
public class UploadCommonUtils {

    public static final String	STL_SALT	= "stlSaltString!@#$%^&*()";

    /**
     * 对密码进行md5加密
     * @param userName userName
     * @param password password
     * @return encrypt password
     */
    public static String encrypt(String userName, String password) {
        String result = new Md5Hash(password, userName + STL_SALT, 2).toHex();
        return result;
    }

    public static void main(String[] args) {
        String adminPassword = "cfd3ad515acf87ff6ebc6ec640e24a80";
        String admin = encrypt("admin", "12345szRX");
        System.out.println(adminPassword.equals(admin));
    }

}
